﻿using System.Collections.Generic;
using System.Linq;
using EstimateTracker.DataAccess.Repositories;
using EstimateTracker.Domain.Entities;
using NUnit.Framework;

namespace EstimateTracker.DataAccess.Tests.Repositories.Integration
{
    [TestFixture]
    public class ActivityRepositoryTest
    {
        [Test]
        public void FindAll_WithPopulatedDatabase_FindsAllInDatabase()
        {
            // Arrange

            // Act
            var activityRepository = new ActivityRepository(new PersistenceManager());
            
            IEnumerable<Activity> activities = activityRepository.FindAll().ToList();
            
            // Assert
            Assert.That(activities, Is.Not.Null);
            Assert.That(activities.Any());
            Assert.That(activities.First().Project, Is.Not.Null);
        }
    }
}